package org.budo.accesslog.entity;

import java.sql.Timestamp;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author limingwei
 */
@Getter
@Setter
@ToString
public class BudoAccesslogEntity implements AccesslogEntity {
    private static final long serialVersionUID = -3066746897229070598L;

    private Integer id;

    private String serverName;

    private String requestUri;

    private String type;

    private String remoteAddr;

    private String userAgent;

    private String handler;

    private Timestamp createdAt;

    private Integer timeCost;

    private String error;

    private String remoteUser;

    private String requestBody;

    private String responseBody;

    public BudoAccesslogEntity() {
        this.setCreatedAt(new Timestamp(System.currentTimeMillis()));
    }

    public BudoAccesslogEntity(String requestUri, String requestBody) {
        this();

        this.setRequestUri(requestUri);
        this.setRequestBody(requestBody);
    }
}